Skip to content

fix: improve error handling - #3336

Open
saurabhhhcodes wants to merge 1 commit into
Karanjot786:mainfrom
saurabhhhcodes:fix1627-86712
Open

fix: improve error handling#3336
saurabhhhcodes wants to merge 1 commit into
Karanjot786:mainfrom
saurabhhhcodes:fix1627-86712

Conversation

@saurabhhhcodes

@saurabhhhcodes saurabhhhcodes commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved numeric HTML entity parsing to handle code points safely and consistently.
    • Improved keyboard-based selection handling for numeric tab and widget shortcuts.
    • Simplified live-wrapper exit handling to prevent unnecessary status updates, output flushing, and cleanup during process exit.

@github-actions github-actions Bot added type:bug +10 pts. Bug fix. area:examples Example apps. labels Jul 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR simplifies CLI wrapper process-exit handling and updates numeric parsing in the RSS reader, showcase, and widget gallery examples.

Changes

Example behavior updates

Layer / File(s) Summary
CLI exit handling
examples/cli-wrapper-live/src/index.tsx
The process-exit chain now only logs errors. Status updates, output flushing, cleanup registration, rendering, and app mounting were removed.
Numeric parsing
examples/rss-reader/src/index.tsx, examples/showcase/src/index.tsx, examples/widget-gallery/src/index.ts
Numeric entity values are limited to 10 characters before parsing. Tab-key parsing now uses radix 10.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: quality:needs-work

Suggested reviewers: karanjot786

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided, so all required template sections and validation details are missing. Add the required description, linked issue, affected packages, change type, checklist status, GSSoC details, and reviewer notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title describes the error-handling change in the CLI wrapper, but it does not cover the numeric parsing fixes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Biome (2.5.5)
examples/cli-wrapper-live/src/index.tsx

File contains syntax errors that prevent linting: Line 67: Expected a statement but instead found '.catch(err=>console.error(err))'.; Line 67: expected } but instead the file ends


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/cli-wrapper-live/src/index.tsx`:
- Line 67: Fix the promise chain in the process-start flow by restoring the
receiver before the `.catch` call at the affected expression. Attach `.catch(err
=> console.error(err))` to the promise returned by the process-start operation,
or remove the handler if that operation no longer returns a promise, ensuring
the TypeScript expression parses correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 15b23b2f-11e0-40ad-a485-fc74cef50702

📥 Commits

Reviewing files that changed from the base of the PR and between 48f63a1 and 23c4652.

📒 Files selected for processing (4)
  • examples/cli-wrapper-live/src/index.tsx
  • examples/rss-reader/src/index.tsx
  • examples/showcase/src/index.tsx
  • examples/widget-gallery/src/index.ts

}

renderApp(LiveWrapper);
.catch(err=>console.error(err)) No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Restore the promise expression before .catch.

Line 67 starts with a member-access operator without a receiver. TypeScript cannot parse this file. Attach .catch(...) to the promise returned by the process-start operation, or remove this line if that promise no longer exists.

🧰 Tools
🪛 Biome (2.5.5)

[error] 67-67: Expected a statement but instead found '.catch(err=>console.error(err))'.

(parse)


[error] 67-67: expected } but instead the file ends

(parse)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/cli-wrapper-live/src/index.tsx` at line 67, Fix the promise chain in
the process-start flow by restoring the receiver before the `.catch` call at the
affected expression. Attach `.catch(err => console.error(err))` to the promise
returned by the process-start operation, or remove the handler if that operation
no longer returns a promise, ensuring the TypeScript expression parses
correctly.

Source: Linters/SAST tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:examples Example apps. type:bug +10 pts. Bug fix.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant